package com.qf.util;

/*
杨威
2021/9/15
17:41
*/
public class Page {
    //页标
    private Integer pageIndex;
    //页大小
    private Integer pageSize;
    //起始行下标
    private Integer startRow;
    //总条数
    private Long totalCount;
    //总页数
    private Long totalPage;
    public Page(Integer pageIndex){
        this.pageIndex=pageIndex;
        this.pageSize=3;
        this.startRow=(pageIndex-1)*this.pageSize;
    }

    public void setPageIndex(Integer pageIndex) {
        this.pageIndex = pageIndex;
    }

    public void setTotalCount(Long totalCount) {
        this.totalCount = totalCount;
        totalPage=totalCount%pageSize==0?totalCount/pageSize:totalCount/pageSize+1;
    }

    public Integer getPageIndex() {
        return pageIndex;
    }

    public Integer getPageSize() {
        return pageSize;
    }

    public Integer getStartRow() {
        return startRow;
    }

    public Long getTotalCount() {
        return totalCount;
    }

    public Long getTotalPage() {
        return totalPage;
    }
}
